<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$return=array();

if($_RQ['op']=='get'){
	$return['item']=core_setting('operating');
	$return['item']['curl']=SITEROOT;
	$wechat=pdo_get('core_account_wechat',array('uniacid'=>1,'isdefault'=>1),array('id','appid','appsecret','type','oldid'));
	if(!$wechat){
		$wechat=pdo_get('core_account_wechat',array('uniacid'=>1),array('id','appid','appsecret','type','oldid'));
	}
	$return['item']['appid']=$wechat['appid'];
	$return['item']['appsecret']=$wechat['appsecret'];
	$htmls=array(
		'type'=>'edit',
		'post'=>'post',
		'desc'=>'运营信息',
		'edit'=>array(
			array('type'=>'ewm','name'=>'curl','title'=>'宣传入口二维码'),
			array('type'=>'copy','title'=>'AppID','name'=>'appid','help'=>'调用管理员默认公众号APPID，用于JSDK分享'),
			array('type'=>'copy','title'=>'AppSecre','name'=>'appsecret','help'=>'调用管理员默认公众号AppSecre，用于JSDK分享'),
			array('type'=>'image','title'=>'宣传头像','name'=>'logo' ),
			array('type'=>'image','title'=>'宣传场景二维码','name'=>'xiu_ewm' ),
			array('type'=>'image','title'=>'小程序演示二维码','name'=>'wxapp_ewm' ),
			array('type'=>'image','title'=>'公众号演示二维码','name'=>'wx_ewm'),
			array('type'=>'string','title'=>'小程序宣传链接','name'=>'wxapp_link','help'=>'留空的话，调用系统默认的！'),
			array('type'=>'string','title'=>'公众号宣传链接','name'=>'wx_link','help'=>'留空的话，调用系统默认的！'),
			array('type'=>'string','title'=>'PC站宣传链接','name'=>'pc_link','help'=>'留空的话，调用系统默认的！'),
			array('type'=>'string','title'=>'APP宣传链接','name'=>'app_link','help'=>'留空的话，调用系统默认的！'),
			array('type'=>'string','title'=>'H5场景宣传链接','name'=>'h5_link','help'=>'留空的话，调用系统默认的！'),
			array('type'=>'string','title'=>'互动营销宣传链接','name'=>'hd_link','help'=>'留空的话，调用系统默认的！'),
			array('type'=>'string','title'=>'小程序游戏宣传链接','name'=>'wxgame_link','help'=>'留空的话，调用系统默认的！'),
			array('type'=>'string','title'=>'在线客服链接','name'=>'kflink','help'=>'留空的话，调用系统默认的！'),
			array('type'=>'text','title'=>'在线客服代码','name'=>'code' )
		)
	);
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='post'){
	$postdata=get_postdata();
	$setting=array('key'=>'operating','value'=>ijson_encode($postdata));
	pdo_insert('core_settings',$setting,true);
	exi('页面信息设置成功！');
}